#主动技能【残戈破晓】
execute as @a[tag=weiersen,scores={skEXBottle=1}] run function nw:yingxiong/3yingxiong/07shihuangzhe/skill/1poxiao
#主动技能【残戈破晓】效果
execute as @a[tag=weiersen,scores={skEXBottle=2}] at @s run effect clear @e[distance=0.1..8] glowing
execute as @a[tag=weiersen,scores={skEXBottle=2}] at @s run effect give @e[distance=0..8] blindness 2 0 true
effect give @a[tag=weiersen,scores={skEXBottle=2}] slowness 1 1 true
effect give @a[tag=weiersen,scores={skEXBottle=2}] glowing 1 0 true
#主动技能【残戈破晓】冲击
execute as @a[tag=weiersen,scores={skCDPlayer1=0,skEXBottle=2}] at @s run function nw:yingxiong/3yingxiong/07shihuangzhe/skill/3chongji

execute as @a[tag=weiersen,scores={skEXBottle=2}] unless data entity @s ActiveEffects[{Id:22b}] run scoreboard players set @s skCDPlayer1 0
scoreboard players set @a[tag=weiersen,scores={skEXBottle=2,skShouShang3=70..}] skCDPlayer1 0
scoreboard players reset @a[tag=weiersen,scores={skEXBottle=2,skShouShang3=70..}] skShouShang3

#主动技能【残戈破晓】CD
execute as @a[tag=weiersen,scores={skCDEXBottle=0}] run function nw:yingxiong/3yingxiong/07shihuangzhe/skill/1poxiao_cd

#主动技能【终末行军】
execute as @a[tag=weiersen,scores={skEgg=1..}] at @s run function nw:yingxiong/3yingxiong/07shihuangzhe/skill/2xingjun
#主动技能【终末行军】效果
execute at @a[tag=weiersen,team=VSBOSS,scores={skCDEgg=9..,skTimeKe=4..}] as @a[team=!VSBOSS,distance=0.1..6] at @s run tp @s ~ ~ ~ facing entity @p[distance=0..6,tag=weiersen,scores={skCDEgg=9..}] feet
execute at @a[tag=weiersen,team=!VSBOSS,scores={skCDEgg=9..,skTimeKe=4..}] as @a[gamemode=!spectator,distance=0.1..6] at @s run tp @s ~ ~ ~ facing entity @p[gamemode=!spectator,distance=0..6,tag=weiersen,scores={skCDEgg=9..}] feet
scoreboard players set @a[tag=weiersen,scores={skTimeKe=6..}] skTimeKe 0
#主动技能【终末行军】CD
execute as @a[tag=weiersen,scores={skCDEgg=0}] run function nw:yingxiong/3yingxiong/07shihuangzhe/skill/2xingjun_cd

#被动技能【天災】
execute as @a[tag=weiersen,nbt={Inventory:[{Slot:-106b,id:"minecraft:shield",Count:1b}]}] at @s run kill @e[type=snowball,distance=0..4]
execute as @a[tag=weiersen,nbt={Inventory:[{Slot:-106b,id:"minecraft:shield",Count:1b}]}] at @s run kill @e[type=fireball,distance=0..4]
execute as @a[tag=weiersen,nbt={Inventory:[{Slot:-106b,id:"minecraft:shield",Count:1b}]}] at @s run tp @e[type=slime,distance=0..4] 900 0 900
#被动技能【苦难】
execute as @a[tag=weiersen] if score @s skShield0 matches 30.. run effect give @s resistance 1 0
scoreboard players reset @a[tag=weiersen,scores={skEXBottle=0}] skShield0


#被动技能【荒土陌路】
execute at @a[tag=weiersen] run scoreboard players add @e[distance=0.1..2,gamemode=!spectator] shihuangzhe5 1
execute at @a[tag=weiersen] run scoreboard players add @e[distance=0.1..4,gamemode=!spectator] shihuangzhe5 1
execute at @a[tag=weiersen] run scoreboard players add @e[distance=0.1..6,gamemode=!spectator] shihuangzhe5 1
execute as @e at @s unless entity @a[tag=weiersen,distance=0.1..6] run scoreboard players remove @s[scores={shihuangzhe5=1..}] shihuangzhe5 2
scoreboard players set @a[scores={shihuangzhe5=..0}] shihuangzhe5 0
#被动技能【荒土淹没】
effect give @e[gamemode=!spectator,scores={shihuangzhe5=100..249}] slowness 1 0 false
effect give @e[gamemode=!spectator,scores={shihuangzhe5=250..399}] slowness 1 1 false
effect give @e[gamemode=!spectator,scores={shihuangzhe5=400..499}] slowness 1 2 false
scoreboard players set @e[gamemode=!spectator,scores={shihuangzhe5=500..,EFLock=0}] EFLock 40
scoreboard players remove @e[gamemode=!spectator,scores={shihuangzhe5=500..,EFLock=..-1}] EFLock 40
effect give @e[gamemode=!spectator,scores={shihuangzhe5=500..}] wither 5 1 true
scoreboard players set @e[gamemode=!spectator,scores={shihuangzhe5=500..}] shihuangzhe5 50

#被动技能【拾荒者之躯】
effect clear @a[tag=weiersen] regeneration
effect clear @a[tag=weiersen] weakness
effect clear @a[tag=weiersen] hunger

#C07维尔森（拾荒者）
execute as @a[tag=weiersen,scores={skEXBottle=2}] run title @s actionbar [{"text":"终末行军","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在进行","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 残戈破晓","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 格挡值：","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skShield0","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"/","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"180","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]

execute as @a[tag=weiersen,scores={skEXBottle=0}] run title @s actionbar [{"text":"终末行军","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEgg","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 残戈破晓","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]